<?xml version="1.0" encoding="UTF-8"?>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
   xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
   xmlns:f="http://xmlns.jcp.org/jsf/core"
   xmlns:h="http://xmlns.jcp.org/jsf/html"
   xmlns:p="http://primefaces.org/ui"
   xmlns:c="http://xmlns.jcp.org/jsp/jstl/core"
   template="/WEB-INF/templates/default.xhtml">
   
   	<f:metadata>
	   	<f:viewParam name="agentServiceId" value="#{agentServiceHome.id}"></f:viewParam>
	   	<f:event listener="#{agentServiceHome.initConversation()}" type="preRenderView"></f:event>
	   	<f:viewParam name="moduleName" value="服务事项管理"></f:viewParam>
   	</f:metadata>
   
   	<ui:define name="content">
   
		<h:form id="editForm">         
			<p:panel id="panel" header="#{agentServiceHome.managed ? '修改' : '新增'}服务事项" style="margin-bottom:10px;">
		       <p:messages id="messages" closable="true"><p:autoUpdate/></p:messages>
		        
		        <h:panelGrid columns="2" cellpadding="5">
					<p:outputLabel for="agentServiceName" value="服务事项名称" />				
					<p:inputText id="agentServiceName" 
							  value="#{agentServiceHome.instance.name}"
						   required="true" />
						   
					<p:outputLabel for="qualificationClass" value="对应资质大类"></p:outputLabel>
					<p:selectOneMenu id="qualificationClass"
								  value="#{agentServiceHome.instance.qualificationClass}">
						<f:selectItem itemLabel="无" itemValue="#{null}" />
						<f:selectItems value="#{qualificationClassList.resultList}" var="_qc" itemLabel="#{_qc.name}" itemValue="#{_qc}"></f:selectItems>
						<f:converter converterId="entityConverter"></f:converter>						
					</p:selectOneMenu>
				</h:panelGrid>
			</p:panel>
			
			<p:panel id="actionButtons">
				<p:commandButton id="saveBtn" action="#{agentServiceHome.saveAndFlush()}" value="保存" ajax="true" />
				<p:commandButton value="删除" action="#{agentServiceHome.delete()}">
					<p:confirm header="请确认" message="您确认删除记录吗?" icon="ui-icon-alert" />
				</p:commandButton>
				<p:commandButton action="#{agentServiceHome.cancel()}" value="取消" immediate="true"></p:commandButton>
			</p:panel>	
			
			<p:blockUI block="editForm" trigger="saveBtn" />
						
			<p:confirmDialog id="confirmDialog" global="true" showEffect="fade" hideEffect="explode" widgetVar="confirmDialog">
			    <p:commandButton value="确认" styleClass="ui-confirmdialog-yes"></p:commandButton>
			    <p:commandButton value="取消" immediate="true" styleClass="ui-confirmdialog-no" />
			</p:confirmDialog>
		</h:form>
      
   	</ui:define>
</ui:composition>
